package view;

import java.awt.Dimension;
import javax.swing.JButton;

import javax.swing.WindowConstants;
import org.jdesktop.application.Action;
import org.jdesktop.application.Application;
import org.jdesktop.application.ApplicationActionMap;

import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class PanelEmpleado extends javax.swing.JPanel {

	/**
	* Auto-generated main method to display this 
	* JPanel inside a new JFrame.
	*/
	private JComboBox jComboBoxMesaIDSector;
	private static PanelEmpleado instancia;
	private JLabel jLabelNomUsu;
	private JButton jButtonGuardarEmp;
	private JLabel jLabelSuc;
	private JPasswordField jTextFieldCPass;
	private JButton jButtonCancelarEmp;
	private JPasswordField jTextFieldPass;
	private JTextField jTextFieldNomUsu;
	private JTextField jTextFieldApeEmp;
	private JTextField jTextFieldNombEmp;
	private JLabel jLabelCPass;
	private JLabel jLabelPass;
	private JLabel jLabel;
	private JLabel jLabelApellido;
	private JLabel jLabelNombre;

	public static PanelEmpleado getInstancia(){
		if(instancia==null){
			instancia=new PanelEmpleado();
		}
		return instancia;
	}
		
	private PanelEmpleado() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			this.setSize(400, 219);
			this.setLayout(null);
			this.add(getJLabelNombre());
			this.add(getJLabelApellido());
			this.add(getJLabelNomUsu());
			this.add(getJLabel());
			this.add(getJLabelPass());
			this.add(getJLabelSuc());
			this.add(getJTextFieldNombEmp());
			this.add(getJTextFieldApeEmp());
			this.add(getJTextFieldNomUsu());
			this.add(getJTextFieldPass());
			this.add(getJTextFieldCPass());
			this.add(getJLabelSucx());
			this.add(getJButtonGuardarEmp());
			this.add(getJButtonCancelarEmp());
			this.add(getJComboBoxMesaIDSector());
			Application.getInstance().getContext().getResourceMap(getClass()).injectComponents(this);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private JLabel getJLabelNombre() {
		if(jLabelNombre == null) {
			jLabelNombre = new JLabel();
			jLabelNombre.setBounds(59, 15, 90, 14);
			jLabelNombre.setName("jLabelNombre");
		}
		return jLabelNombre;
	}
	
	private JLabel getJLabelApellido() {
		if(jLabelApellido == null) {
			jLabelApellido = new JLabel();
			jLabelApellido.setBounds(59, 42, 90, 14);
			jLabelApellido.setName("jLabelApellido");
		}
		return jLabelApellido;
	}
	
	private JLabel getJLabelNomUsu() {
		if(jLabelNomUsu == null) {
			jLabelNomUsu = new JLabel();
			jLabelNomUsu.setBounds(59, 71, 118, 14);
			jLabelNomUsu.setName("jLabelNomUsu");
		}
		return jLabelNomUsu;
	}
	
	private JLabel getJLabel() {
		if(jLabel == null) {
			jLabel = new JLabel();
			jLabel.setBounds(61, 97, 34, 14);
			jLabel.setName("jLabel");
		}
		return jLabel;
	}
	
	private JLabel getJLabelPass() {
		if(jLabelPass == null) {
			jLabelPass = new JLabel();
			jLabelPass.setBounds(60, 98, 88, 14);
			jLabelPass.setName("jLabelPass");
		}
		return jLabelPass;
	}
	
	private JLabel getJLabelSuc() {
		if(jLabelCPass == null) {
			jLabelCPass = new JLabel();
			jLabelCPass.setBounds(60, 125, 118, 14);
			jLabelCPass.setName("jLabelCPass");
		}
		return jLabelCPass;
	}
	
	private JTextField getJTextFieldNombEmp() {
		if(jTextFieldNombEmp == null) {
			jTextFieldNombEmp = new JTextField();
			jTextFieldNombEmp.setBounds(206, 12, 124, 21);
		}
		return jTextFieldNombEmp;
	}
	
	private JTextField getJTextFieldApeEmp() {
		if(jTextFieldApeEmp == null) {
			jTextFieldApeEmp = new JTextField();
			jTextFieldApeEmp.setBounds(206, 39, 124, 21);
		}
		return jTextFieldApeEmp;
	}
	
	private JTextField getJTextFieldNomUsu() {
		if(jTextFieldNomUsu == null) {
			jTextFieldNomUsu = new JTextField();
			jTextFieldNomUsu.setBounds(206, 68, 124, 21);
		}
		return jTextFieldNomUsu;
	}
	
	private JTextField getJTextFieldPass() {
		if(jTextFieldPass == null) {
			jTextFieldPass = new JPasswordField();
			jTextFieldPass.setBounds(206, 95, 124, 21);
		}
		return jTextFieldPass;
	}
	
	private JTextField getJTextFieldCPass() {
		if(jTextFieldCPass == null) {
			jTextFieldCPass = new JPasswordField();
			jTextFieldCPass.setBounds(206, 122, 124, 21);
		}
		return jTextFieldCPass;
	}
	
	private JLabel getJLabelSucx() {
		if(jLabelSuc == null) {
			jLabelSuc = new JLabel();
			jLabelSuc.setBounds(60, 149, 118, 14);
			jLabelSuc.setName("jLabelSuc");
		}
		return jLabelSuc;
	}
	
	private JButton getJButtonGuardarEmp() {
		if(jButtonGuardarEmp == null) {
			jButtonGuardarEmp = new JButton();
			jButtonGuardarEmp.setBounds(112, 175, 83, 21);
			jButtonGuardarEmp.setName("jButtonGuardarEmp");
			jButtonGuardarEmp.setAction(getAppActionMap().get("abstractActionGuardarEmp"));
		}
		return jButtonGuardarEmp;
	}
	
	@Action
	public void abstractActionGuardarEmp() {
		
		//TO DO
	}
	
    /**
    * Returns the action map used by this application.
     * Actions defined using the Action annotation
     * are returned by this method
     */
	private ApplicationActionMap getAppActionMap() {
		return Application.getInstance().getContext().getActionMap(this);
	}
    
    private JButton getJButtonCancelarEmp() {
    	if(jButtonCancelarEmp == null) {
    		jButtonCancelarEmp = new JButton();
    		jButtonCancelarEmp.setBounds(206, 175, 101, 21);
    		jButtonCancelarEmp.setName("jButtonCancelarEmp");
    		jButtonCancelarEmp.setAction(getAppActionMap().get("abstractActionCancelarEmp"));
    	}
    	return jButtonCancelarEmp;
    }
    
	@Action
	public void abstractActionCancelarEmp() {
		instancia.setVisible(false);
		
	}
	
	private JComboBox getJComboBoxMesaIDSector() {
		if(jComboBoxMesaIDSector == null) {
			ComboBoxModel jComboBoxMesaIDSectorModel = 
				new DefaultComboBoxModel(
						new String[] { "Item One", "Item Two" });
			jComboBoxMesaIDSector = new JComboBox();
			jComboBoxMesaIDSector.setModel(jComboBoxMesaIDSectorModel);
			jComboBoxMesaIDSector.setBounds(206, 146, 96, 21);
		}
		return jComboBoxMesaIDSector;
	}
}
